home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
education
/
pe058.dms
/
pe058.adf
/
spell.AMOS
/
spell.amosSourceCode
Wrap
AMOS Source Code
|
1978-01-06
|
12KB
|
373 lines
Rem ------------------------------------
Rem -- --
Rem -- SPELLING PROGRAMME BY D.S.FARR --
Rem -- --
Rem -- 15/8/90 --
Rem -- --
Rem ------------------------------------
Rem main programme
Curs Off : Hide : Cls 0
If Chip Free>250000
ENOUGH_MEM=True
Else
ENOUGH_MEM=False
End If
Flash 1,"(007,10)(007,10)"
Locate 16,10 : Pen 1 : Paper 0 : Print "LOADING" : Locate 14,12 : Pen 1 : Paper 0 : Print "PLEASE WAIT"
Locate 1,20 : Paper 0 : Pen 1 : Print "- Please leave the disk in the drive -"
Locate 1,22 : Paper 0 : Pen 1 : Print " - Remove any external disk drive -" : If ENOUGH_MEM=False Then Wait 60
Global CHECK
Global ENOUGH_MEM
Global QUIT
Global WORD$
Dim COMP(6)
Dim COMP$(6)
Global COMP()
Global COMP$()
Global CLONE$
Global LONG
Global TALLY
Global TALLYHO
Channel 1 To Bob 1 : Rem crate
Channel 2 To Bob 2 : Rem main letters (2 to 7)
Channel 3 To Bob 3
Channel 4 To Bob 4
Channel 5 To Bob 5
Channel 6 To Bob 6
Channel 7 To Bob 7
Channel 8 To Bob 8 : Rem small letters
Channel 9 To Bob 9 : Rem fork lift
Channel 10 To Bob 10 : Rem crane line
Channel 11 To Bob 11 : Rem crane hook
Channel 12 To Bob 12 : Rem no man
Channel 13 To Bob 13 : Rem yes man
Channel 14 To Bob 14 : Rem numbers
If ENOUGH_MEM
Load "spelling:sprites/sprite.abk"
Load "spelling:samples/Samples.Abk"
Else
Load "spelling:sprites/spritelow.abk"
End If
Rem ******************************
Rem ******** MAIN LOOP ***********
Do
CHECK=0 : QUIT=0
Proc OPTIONS
Repeat
Proc WORDSTUDY
Locate 8,8 : Paper 0 : Pen 2 : Print "LETS"
Locate 13,8 : Paper 0 : Pen 3 : Print "GO"
Locate 16,8 : Paper 0 : Pen 4 : Print "INTO"
Locate 21,8 : Paper 0 : Pen 5 : Print "THE"
Locate 25,8 : Paper 0 : Pen 6 : Print "FACTORY" : Wait 40
If ENOUGH_MEM
Proc SPELL_HIGH
Else
Proc SPELL_LOW
End If
Proc COMPARE_WORD
While CLONE$<>WORD$ and QUIT=0
Proc NOCORRECT
If ENOUGH_MEM
Proc SPELL_HIGH
Else
Proc SPELL_LOW
End If
Proc COMPARE_WORD
Wend
If QUIT=0 Then Proc CORRECT
If QUIT=0 and TALLY=10 Then Proc TRUCK
Until QUIT=1
Rem ***************************
Rem ***************************
Procedure OPTIONS
TALLY=0
TALLYHO=0
Load Iff "spelling:iff/option.iff",0
While CHECK=0
OPTION$=Input$(1)
If OPTION$="e" Then CHECK=1 : Bell(50) : Wait 7
If OPTION$="m" Then CHECK=2 : Bell(50) : Wait 7
If OPTION$="h" Then CHECK=3 : Bell(50) : Wait 7
If CHECK=0 Then Bell(5) : Wait 5
Wend
OPTION1$=Upper$(OPTION$)
Locate 19,23 : Paper 3 : Pen 1 : Print OPTION1$
Wait 40
Fade 3 : Wait 45
If CHECK=1 Then Open Random 1,"easy" : Field 1,4 As WORD$
If CHECK=2 Then Open Random 2,"medium" : Field 2,5 As WORD$
If CHECK=3 Then Open Random 3,"hard" : Field 3,6 As WORD$
Randomize Timer
End Proc
Rem
Procedure WORDSTUDY
Load Iff "spelling:iff/cogsword.iff",0
Flash Off : Double Buffer
Rem *** RANDOM WORD SELECT ***
INDEX=Rnd(333) : If INDEX=0 Then INDEX=1 : LONG=0
If CHECK=1 Then Get 1,INDEX : LONG=4 : POS=51
If CHECK=2 Then Get 2,INDEX : LONG=5 : POS=31
If CHECK=3 Then Get 3,INDEX : LONG=6 : POS=14
LETTER=0
B=2
For A=1 To LONG
TEMP$=Mid$(WORD$,A,1)
POS=POS+38
If TEMP$="a" Then LETTER=1
If TEMP$="b" Then LETTER=2
If TEMP$="c" Then LETTER=3
If TEMP$="d" Then LETTER=4
If TEMP$="e" Then LETTER=5
If TEMP$="f" Then LETTER=6
If TEMP$="g" Then LETTER=7
If TEMP$="h" Then LETTER=8
If TEMP$="i" Then LETTER=9
If TEMP$="j" Then LETTER=10
If TEMP$="k" Then LETTER=11
If TEMP$="l" Then LETTER=12
If TEMP$="m" Then LETTER=13
If TEMP$="n" Then LETTER=14
If TEMP$="o" Then LETTER=15
If TEMP$="p" Then LETTER=16
If TEMP$="q" Then LETTER=17
If TEMP$="r" Then LETTER=18
If TEMP$="s" Then LETTER=19
If TEMP$="t" Then LETTER=20
If TEMP$="u" Then LETTER=21
If TEMP$="v" Then LETTER=22
If TEMP$="w" Then LETTER=23
If TEMP$="x" Then LETTER=24
If TEMP$="y" Then LETTER=25
If TEMP$="z" Then LETTER=26
Bob B,POS,100,LETTER
Inc B
Next A
Rem *** COUNT DOWN NUMBER ***
If ENOUGH_MEM
IMAGE=108
Else
IMAGE=32
End If
Wait 40
For A=1 To 5
Bob 14,137,180,IMAGE
Bell(19)
Wait 65
IMAGE=IMAGE-1
Next A
Wait 40 : Bob Off : Cls 0
End Proc
Rem
Procedure SPELL_LOW
Load Iff "spelling:iff/factory.iff",0 : Double Buffer
Rem *** JOYSTICK CODE ***
LONG=Len(WORD$)
POS1=94
SELECT=1
For A=1 To LONG
If PICK=1 Then Wait 12
PICK=0
While PICK=0
If Jright(1) Then SELECT=SELECT+1 : Bell(5) : If SELECT=28 Then SELECT=1
If Jleft(1) Then SELECT=SELECT-1 : Bell(5) : If SELECT<1 Then SELECT=27
If Fire(1) Then PICK=1
Bob 8,240,0,SELECT
Wait 6
Wend
If SELECT=27 Then Close : Boom : QUIT=1 : Pop Proc
Bob A,POS1,98,SELECT
POS1=POS1+38
COMP(A)=SELECT
Next A
End Proc
Procedure SPELL_HIGH
Load Iff "spelling:iff/factory.iff",0 : Double Buffer
LONG=Len(WORD$)
POS1=94
SELECT=1 : SMALL=27 : B=2
Rem
Rem FORK LIFT ANIMATION
Bob 9,320,179,54
A$="A0,(54,5)(110,5);"
A$=A$+"M-292,0,292" : Sam Loop On : Amal 9,A$ : Amal On 9 : Sam Play 6 : Wait 295 : Sam Loop Off
Amal 9,"A1,(54,2)(55,2)(56,2)(57,2)(58,2)(59,2)(60,2);" : Amal On 9 : Wait 20 : Sam Play 13 : Wait 40
Bob 1,28,201,109
Bob 9,28,179,61
Amal 9,"M300,0,25" : Amal On 9 : Wait 10 : Sam Play 14 : Wait 38 : Bob Off 9
Rem
Rem *** JOYSTICK CODE ***
For A=1 To LONG
If PICK=1 Then Wait 12
PICK=0
While PICK=0
If Jright(1) Then SELECT=SELECT+1 : SMALL=SMALL+1 : Bell(5) : If SELECT=28 Then SELECT=1 : If SMALL=54 Then SMALL=27
If Jleft(1) Then SELECT=SELECT-1 : SMALL=SMALL-1 : Bell(5) : If SELECT<1 Then SELECT=27 : If SMALL<27 Then SMALL=53
If Fire(1) Then PICK=1 : Sam Play 5
Bob 8,240,0,SMALL
Wait 6
Wend
If SELECT=27 Then Close : Boom : QUIT=1 : Pop Proc
Bob B,POS1,98,SELECT
POS1=POS1+38
COMP(A)=SELECT
Inc B
Next A
Wait 15 : Bob Off 8
Rem
Rem *** MOVE LETTERS TOGETHER ***
Wait 20
TEMP=LONG+1
TEMP2=LONG
ROLL=LONG-1
For W=1 To ROLL
Amal TEMP,"M-38,0,10" : Sam Loop On : Sam Play 3 : Amal On TEMP : Sam Loop Off : Wait 10
Bob Off TEMP2 : TEMP2=TEMP2-1
Next W
Wait 40
Rem
Rem *** MOVE CRANE ANIMATION ***
Bob 11,23,-82,77
Amal 11,"M0,81,20" : Amal On 11 : Sam Play 9 : Wait 20
Amal 11,"A1,(77,3)(78,3)(79,3)(80,3)(81,3)(82,3)(83,3)(84,3)(85,3)(86,3)" : Sam Loop On : Sam Play 8 : Amal On 11 : Wait 30 : Sam Loop Off
Amal 11,"M0,168,15" : Sam Loop On : Sam Play 9 : Amal On 11 : Sam Loop Off
Bob 10,39,-1,62
Amal 10,"A1,(62,1)(63,1)(64,1)(65,1)(66,1)(67,1)(68,1)(69,1)(70,1)(71,1)(72,2)(73,1)(74,1)(75,1)(76,1)" : Amal On 10 : Wait 40
Bob 11,23,167,87
Bob Off 1
Amal 11,"M0,-168,15" : Sam Loop On : Sam Play 9 : Amal On 11 : Sam Loop Off
Amal 10,"A1,(76,1)(75,1)(74,1)(73,1)(72,1)(71,1)(70,1)(69,1)(68,1)(67,1)(66,1)(65,1)(64,1)(63,1)(62,1)" : Amal On 10 : Wait 45
Bob Off 10
Amal 11,"M64,0,15" : Sam Loop On : Sam Play 9 : Amal On 11 : Wait 20 : Sam Loop Off
Amal 11,"M0,53,15" : Sam Loop On : Sam Play 9 : Amal On 11 : Sam Loop Off
Bob 10,103,-3,62
Amal 10,"A1,(62,1)(63,1)(64,1)(65,1)(66,1)(67,1)" : Amal On 10 : Wait 20
Bob Off TEMP
Amal 11,"M0,-53,15" : Sam Loop On : Sam Play 9 : Amal On 11 : Sam Loop Off
Amal 10,"A1,(67,1)(66,1)(65,1)(64,1)(63,1)(62,1)" : Amal On 10 : Wait 20
Bob Off 10
Amal 11,"M260,0,15" : Sam Loop On : Sam Play 9 : Amal On 11 : Wait 10 : Sam Loop Off
Wait 35
End Proc
Procedure COMPARE_WORD
LONG=Len(WORD$)
For A=1 To LONG
If COMP(A)=1 Then COMP$(A)="a"
If COMP(A)=2 Then COMP$(A)="b"
If COMP(A)=3 Then COMP$(A)="c"
If COMP(A)=4 Then COMP$(A)="d"
If COMP(A)=5 Then COMP$(A)="e"
If COMP(A)=6 Then COMP$(A)="f"
If COMP(A)=7 Then COMP$(A)="g"
If COMP(A)=8 Then COMP$(A)="h"
If COMP(A)=9 Then COMP$(A)="i"
If COMP(A)=10 Then COMP$(A)="j"
If COMP(A)=11 Then COMP$(A)="k"
If COMP(A)=12 Then COMP$(A)="l"
If COMP(A)=13 Then COMP$(A)="m"
If COMP(A)=14 Then COMP$(A)="n"
If COMP(A)=15 Then COMP$(A)="o"
If COMP(A)=16 Then COMP$(A)="p"
If COMP(A)=17 Then COMP$(A)="q"
If COMP(A)=18 Then COMP$(A)="r"
If COMP(A)=19 Then COMP$(A)="s"
If COMP(A)=20 Then COMP$(A)="t"
If COMP(A)=21 Then COMP$(A)="u"
If COMP(A)=22 Then COMP$(A)="v"
If COMP(A)=23 Then COMP$(A)="w"
If COMP(A)=24 Then COMP$(A)="x"
If COMP(A)=25 Then COMP$(A)="y"
If COMP(A)=26 Then COMP$(A)="z"
Next A
If LONG=4 Then CLONE$=COMP$(1)+COMP$(2)+COMP$(3)+COMP$(4)
If LONG=5 Then CLONE$=COMP$(1)+COMP$(2)+COMP$(3)+COMP$(4)+COMP$(5)
If LONG=6 Then CLONE$=COMP$(1)+COMP$(2)+COMP$(3)+COMP$(4)+COMP$(5)+COMP$(6)
End Proc
Procedure CORRECT
TALLY=TALLY+1 : Rem COUNT OF WORDS CORRECT TO A TOTAL OF 10
If ENOUGH_MEM
Load Iff "spelling:iff/correct.iff",0
Load "spelling:music/correct.abk"
Flash Off : Double Buffer : Music 1
Bob 13,-60,208,96
A$="A0,(96,3)(97,3)(98,3)(99,3)(98,3)(97,3)(96,3)(100,3)(101,3)(102,3)(103,3)(102,3)(101,3)(100,3);"
A$=A$+"M 400,0,250"
Amal 13,A$ : Amal On 13 : Wait 255
Else
Load Iff "spelling:iff/correct.iff",0
Load "spelling:music/correct.abk"
Music 1
Wait 255
End If
Music Off
End Proc
Procedure NOCORRECT
If ENOUGH_MEM
Load Iff "spelling:iff/wrong.iff",0
Load "spelling:music/wrong.abk"
Music 1
Flash Off : Double Buffer
Bob 12,-60,208,88
A$="A0,(88,3)(89,3)(90,3)(91,3)(90,3)(89,3)(88,3)(92,3)(93,3)(94,3)(95,3)(94,3)(93,3)(92,3);"
A$=A$+"M 400,0,250"
Amal 12,A$ : Amal On 12 : Wait 230
Else
Load Iff "spelling:iff/wrong.iff",0
Load "spelling:music/wrong.abk"
Music 1
End If
For X=82 To 160
Cls 0,40,82 To 280,X
If ENOUGH_MEM=False Then Wait 2
Next X
Wait 5
If LONG=4 Then POS=48
If LONG=5 Then POS=28
If LONG=6 Then POS=9
For A=1 To LONG
TEMP$=Mid$(WORD$,A,1)
POS=POS+38
If TEMP$="a" Then LETTER=1
If TEMP$="b" Then LETTER=2
If TEMP$="c" Then LETTER=3
If TEMP$="d" Then LETTER=4
If TEMP$="e" Then LETTER=5
If TEMP$="f" Then LETTER=6
If TEMP$="g" Then LETTER=7
If TEMP$="h" Then LETTER=8
If TEMP$="i" Then LETTER=9
If TEMP$="j" Then LETTER=10
If TEMP$="k" Then LETTER=11
If TEMP$="l" Then LETTER=12
If TEMP$="m" Then LETTER=13
If TEMP$="n" Then LETTER=14
If TEMP$="o" Then LETTER=15
If TEMP$="p" Then LETTER=16
If TEMP$="q" Then LETTER=17
If TEMP$="r" Then LETTER=18
If TEMP$="s" Then LETTER=19
If TEMP$="t" Then LETTER=20
If TEMP$="u" Then LETTER=21
If TEMP$="v" Then LETTER=22
If TEMP$="w" Then LETTER=23
If TEMP$="x" Then LETTER=24
If TEMP$="y" Then LETTER=25
If TEMP$="z" Then LETTER=26
Bob A,POS,100,LETTER
Next A
Wait 370
Music Off
End Proc
Procedure TRUCK
TALLYHO=TALLYHO+1 : Rem COUNT OF TRUCKS FILLED (BLOCKS OF 10 WORDS)
TALLY=0
Load Iff "spelling:iff/tomstruck.iff",0
Load "spelling:music/truckmusic.abk"
Music 1
Locate 11,7 : Paper 0 : Print "YOU HAVE FILLED";TALLYHO;" OF"
Locate 14,9 : Paper 0 : Print "TOMMYS TRUCKS"
Wait 400
Music Off
Fade 3 : Wait 45
End Proc
Loop